// include the Node.js 'path' module at the top of your file
const path = require('path')
const { app, BrowserWindow } = require('electron')
let mode = process.env.MODE;
const createWindow = () => {
    const win = new BrowserWindow({
        width: 1920,
        height: 1080,
        webPreferences: {
            nodeIntegration:true,
            contextIsolation: false,
            preload: path.join(__dirname, 'preload.js')
        }
    })
	win.loadFile(path.join('http://localhost:3000/'))
    // if(mode == "development"){
    //     win.loadFile(path.join('http://localhost:3000/'))
    // }else{
    //     win.loadFile(path.join(__dirname, 'dist/index.html'))
    // }
    
}
app.whenReady().then(() => {
    createWindow()
})
app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') app.quit()
})